package com.financing.platform.dao.impl;



import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IProjectCompanyDao;
import com.financing.platform.dao.IThirdPartyCompanyDao;
import com.financing.platform.dto.ProjectCompanyDTO;
import com.financing.platform.dto.ThirdPartyCompanyDTO;
import com.financing.platform.util.SqlName;
@SuppressWarnings("unchecked")
@Repository("tpCompanyDaoImpl")
public class ThirdPartyCompanyDaoImpl extends BaseDaoImpl 
		implements IThirdPartyCompanyDao { 


	@Override
	public List<ThirdPartyCompanyDTO> getThirdPartyCompanyList(
			ThirdPartyCompanyDTO tpCompanyDTO) throws SQLException {
		return (List<ThirdPartyCompanyDTO>)this.sqlMapClient.queryForList(SqlName.queryThirdPartyCompany, tpCompanyDTO);
	}

	@Override
	public int updateThirdPartyCompany(ThirdPartyCompanyDTO tpCompanyDTO)
			throws SQLException {
		return this.sqlMapClient.update(SqlName.updateThirdPartyCompany, tpCompanyDTO);
	}

	@Override
	public int addThirdPartyCompany(ThirdPartyCompanyDTO tpCompanyDTO)
			throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.addThirdPartyCompany, tpCompanyDTO);
	}
	@Override
	public int getThirdPartyCompanyListCount(ThirdPartyCompanyDTO tpCompanyDTO) throws SQLException {
		return (Integer)this.sqlMapClient.queryForObject(SqlName.queryThirdPartyCompanyCount, tpCompanyDTO);
	}

	@Override
	public int delThirdPartyCompany(int tpCompanyId) throws SQLException {
		return this.sqlMapClient.delete(SqlName.delThirdPartyCompany, tpCompanyId);
	}

}
